package com.okaixz.common.client.utils;

import com.github.pagehelper.PageInfo;
import com.okaixz.common.constant.HttpStatus;
import com.okaixz.common.core.page.TableDataInfo;

import java.util.List;

/**
 * @author 陈大专
 * @time 2024/8/28 11:46
 * @des
 **/
public class MyPageUtil {

    public static TableDataInfo getDataTable(List<?> list)
    {
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("查询成功");
        rspData.setRows(list);
        rspData.setTotal(new PageInfo(list).getTotal());
        return rspData;
    }
}
